	/*
 * Created on Jun 23, 2005
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package org.peterrussell.contractionTimer.view;

import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Graphics;

/**
 * @author peterr
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class ConfirmSave extends Canvas implements CommandListener {

	private Command yesCommand;
	private Command noCommand;
	
	/**
	 * 
	 */
	public ConfirmSave() {
        yesCommand = new Command("Yes", Command.OK, 1);
        noCommand = new Command("No", Command.BACK, 0);
        this.addCommand(yesCommand);
        this.addCommand(noCommand);
        this.setCommandListener(this);
	}
	 public void paint (Graphics g) {
	    g.setGrayScale (255);
	    g.fillRect (0, 0, getWidth (), getHeight ());
	    g.setGrayScale (0);
	    g.drawString("Do you wish to save this contraction?",10,10,0);
	    
	  }
	/* (non-Javadoc)
	 * @see javax.microedition.lcdui.CommandListener#commandAction(javax.microedition.lcdui.Command, javax.microedition.lcdui.Displayable)
	 */
	public void commandAction(Command cmd, Displayable canvas) {
        if (cmd == noCommand) {
        	System.out.println("NO!!!");
        }
        if (cmd == yesCommand) {
        	System.out.println("YES!!!");
        }
		
	}
}
